 package com.wanma.annotaion;

import java.lang.reflect.Field;

public class Main {
	/**
	 * 模拟orm框架
	 * @param args
	 * @throws ClassNotFoundException 
	 */
	public static void main(String[] args) throws ClassNotFoundException {
		@SuppressWarnings("rawtypes")
		Class class1 = Class.forName("com.wanma.annotaion.User");
		//Annotation[] annotations = class1.getAnnotations();
//		for (int i = 0; i < annotations.length; i++) {
//			Annotation annotation = annotations[i];
//			System.out.println(annotation.toString());
//		}
		@SuppressWarnings("unchecked")
		SetTable annotation =   (SetTable) class1.getAnnotation(SetTable.class);
		System.out.println(annotation.value());
		Field[] fields = class1.getDeclaredFields();
		for (int i = 0; i < fields.length; i++) {
			Field field = fields[i];
			SetPropertity setPropertity = field.getAnnotation(SetPropertity.class);
			System.out.println(setPropertity.value());
		}
	}
}
